package com.ck.ips.model.vo.statics;

import com.ck.core.util.DateUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.io.Serializable;
import java.text.ParseException;

/**
 * @description: 设备状态汇总
 * @author: huangf
 * @date: 2019/5/16 13:09
 */
public class DeviceStatusSummaryDailyVO implements Serializable {
    /**
     * 主键id
     */
    @JsonIgnore
    private Long id;

    /**
     * 在线设备汇总
     */
    private Long totalOnline;

    /**
     * 离线设备汇总
     */
    private Long totalOffline;

    /**
     * 记录时间
     */
    private String markDate;

    /**
     * 记录时间的当天0点的时间戳
     */
    private Long markDateNum;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getTotalOnline() {
        return totalOnline;
    }

    public void setTotalOnline(Long totalOnline) {
        this.totalOnline = totalOnline;
    }

    public Long getTotalOffline() {
        return totalOffline;
    }

    public void setTotalOffline(Long totalOffline) {
        this.totalOffline = totalOffline;
    }

    public String getMarkDate() {
        return markDate;
    }

    public void setMarkDate(String markDate) {
        this.markDate = markDate;
    }

    public Long getMarkDateNum() {
        return markDateNum;
    }

    public void setMarkDateNum(Long markDateNum) {
        this.markDateNum = markDateNum;
    }

    public DeviceStatusSummaryDailyVO() {
        super();
    }

    public DeviceStatusSummaryDailyVO(String markDate) {
        this.markDate = markDate;
        try{
            this.markDateNum = DateUtils.stringTimeToLongTimeStamp(markDate,DateUtils.PATTEN_YMD);
        } catch (ParseException e) {
            // do nothing
        }
    }

    @Override
    public String toString() {
        return "DeviceStatusSummaryDailyVO{" +
                "id=" + id +
                ", totalOnline=" + totalOnline +
                ", totalOffline=" + totalOffline +
                ", markDate='" + markDate + '\'' +
                '}';
    }
}
